package top.kaoshanji.p1ch05a;

import java.util.Random;

/**
 * 代码清单-p1ch05a-095页a：展示switch语句
 * author kaoshanji
 * ^_^
 * create time 2025/3/7 19:08
 */
public class VowelsAndConsonants {

    public static void main(String[] args) {
        Random rand = new Random(47);
        for (int i = 0; i < 100; i++) {
            int c = rand.nextInt(26) + 'a';
            System.out.println((char) c + ", " + c + ": ");

            switch (c) {
                case 'a':
                case 'e':
                case 'i':
                case 'o':
                case 'u': System.out.println("vowel");
                    break;
                case 'y':
                case 'w': System.out.println("Sometimes vowel");
                    break;
                default:  System.out.println("consonant");
            }

        }
    }



}
